This section has an example of an abstract factory and two concrete implementations. The abstract factory returns math operators used by a calculator. The operators are examples of the Strategy pattern, aka function object, functor.
Here's the abstract factory class: MathOperatorFactory.h
Abstract Factory Pattern Example
This section has an example of an abstract factory and two concrete implementations. The abstract factory returns math operators used by a calculator. The operators are examples of the Strategy pattern, aka function object, functor.Here's the abstract factory class:
MathOperatorFactory.h
MathoOperatorFactory.cpp
Here's a basic factory that provides MathOperators using conditional and static variables within a method:
IfBasedMathOperatorFactory.cpp
And here's one that uses words like "plus" and "factorial" instead of "+" and "!":
FullyNamedMathOperatorFactory
<--Back